﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using ModuleDALCore;
using DTO;

namespace DAL
{
	public class HESOTROTHUDAO:DALBase
	{
		public HESOTROTHUDAO()
		{
			this.OpenConnect();
		}
		private DataTable dt;
		private string _SpName;

		public string SpName
		{
			get { return "SPHESOTROTHU"; }
			set { _SpName = value; }
		}
		public DataTable GetListDSTROTHU(HESOTROTHU hs)
		{
			dt = new DataTable();
			try
			{

				dt = DBManager.Intance.ExecuteDataTable(SpName, ConvertClassToArray.GetParamName(hs, null), ConvertClassToArray.GetValues(hs, 0));
				return dt;
			}
			catch { return null; }
		}
		public bool INSERT(HESOTROTHU cv)
		{

			try
			{
				return (DBManager.Intance.ExecuteNonQuery(SpName, ConvertClassToArray.GetParamName(cv, null), ConvertClassToArray.GetValues(cv, 1)) == 1);

			}
			catch { return false; }
		}
		public bool UPDATE(HESOTROTHU cv)
		{

			try
			{
				return (DBManager.Intance.ExecuteNonQuery(SpName, ConvertClassToArray.GetParamName(cv, null), ConvertClassToArray.GetValues(cv, 2)) == 1);

			}
			catch { return false; }
		}
		public bool DELETE(HESOTROTHU cv)
		{

			try
			{
				return (DBManager.Intance.ExecuteNonQuery(SpName, ConvertClassToArray.GetParamName(cv, null), ConvertClassToArray.GetValues(cv, 3)) == 1);

			}
			catch { return false; }
		}
	}
}